<template>
    <BPTable align='center' row-key='id' :columns='columns' :api='page' :rowSelection="true" :selection-buttons="selectionButtons" @selectionChange="selectionChange"></BPTable>
</template>

<script lang="ts" setup>
    import { ref } from 'vue';
    import { pageApi } from '@/api/devices/Device'

    const emit = defineEmits<{
        (e : 'select', value : number[]) : void
    }>()

    function page(params:any){
        return pageApi({...params, stationId : 0})
    }


    function selectionChange(keys:number[], rows:any[]) {
       emit('select', keys)
    }


    const columns = ref<Column[]>([
        {
            title : '设备号',
            dataIndex : 'id',
            align : 'center',
            inSearch : true,
        },

        {
            title : '名称',
            dataIndex : 'name',
            align : 'center',
        }
    ])
</script>